//利用pinia代替vuex
import {createPinia, defineStore} from "pinia";
import piniaPluginPersist from 'pinia-plugin-persist'

const store = createPinia()
store.use(piniaPluginPersist)

export default store

// useStore可以是任何类似useUser、useCart的东西
// 第一个参数是应用程序中 Store 的唯一id
export const shiyanStore = defineStore("shiyanStore", {
    state: () => {
        return {
            id: ''
        };
    },
    persist: {
        enabled: true
    }
});

export const userStore = defineStore("student", {
    state: () => {
        return {
            student_id: '',
            teacher_id: '',
            admin_id: '',
        }
    },
    persist: {
        enabled: true
    }
})
export const CourseStore = defineStore("course",{
    state: () => {
        return {
            course_id:'',
        }
    },
    persist: {
        enabled: true
    }
})
